package com.example.xiangjt.ethwalletdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import org.beykery.eth.WillWallet;
import org.web3j.crypto.CipherException;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        test();
    }

    private void test() {
        String mnemonic = "thought gun place enroll remove express saddle sustain transfer object palm town";
        String path = "m/44'/60'/0'/0/0";
        try {
            WillWallet wa = WillWallet.fromMnemonic(null, mnemonic, path);
            Log.v("xiangjt", "address: " + wa.getAddress());
            Log.v("xiangjt", "private key: " + wa.getPrivateKey());
        } catch (CipherException e) {
            e.printStackTrace();
        }
    }
}
